#Contains the soil hydraulic parameters of sandy clay loam and the function
#for converting volumetric soil moisture to pressure head.

import numpy as np 
pars_MZs = np.loadtxt('./core_mz2/Parameters_LSTM.txt')

def ManagementZone_2():
    soilPars = {}
    soilPars['thetaR'] = pars_MZs[1,4]
    soilPars['thetaS'] = pars_MZs[1,1]
    soilPars['alpha']  = pars_MZs[1,2]
    soilPars['n']      = pars_MZs[1,3]
    soilPars['m']      = 1-1/soilPars['n']
    soilPars['Ks']     = (pars_MZs[1,0])/86400
    soilPars['neta']   = 0.5
    soilPars['Ss']     = 0.00001

    return soilPars

def ConvertToPressureHead(volMoisture,soilPars):
	#Dependence of pressure head on the volumetric moisture content
	presHead = (((((volMoisture - soilPars['thetaR']) / (soilPars['thetaS'] - soilPars['thetaR'])) ** (1. / (-(1-1/(soilPars['n']))))
              - 1)) ** (1. / (soilPars['n']))) / (-soilPars['alpha'])
	return presHead
